import request from '@/utils/request'

// 查询入库单据列表
export function listReceipt(query) {
  return request({
    url: '/enterwarehouse/enter/list',
    method: 'get',
    params: query
  })
}

// 查询入库单据详细
export function getReceipt(enterWarehouseId) {
  return request({
    url: '/enterwarehouse/enter/' + enterWarehouseId,
    method: 'get'
  })
}

// 新增入库单据
export function addReceipt(data) {
  return request({
    url: '/enterwarehouse/enter',
    method: 'post',
    data: data
  })
}

// 修改入库单据
export function updateReceipt(data) {
  return request({
    url: '/enterwarehouse/enter',
    method: 'put',
    data: data
  })
}

// 删除入库单据
export function delReceipt(enterWarehouseId) {
  return request({
    url: '/enterwarehouse/enter/' + enterWarehouseId,
    method: 'delete'
  })
}

// 修改入库状态
export function revokeEnterWarehouse(data) {
  return request({
    url: '/enterwarehouse/enter/revoke',
    method: 'put',
    data: data
  })
}

// 查询重量
export function getEnterWeightSum(query) {
  return request({
    url: '/enterwarehouse/enter/enterweightsum',
    method: 'get',
    params: query
  })
}

// 交换重量
export function exchangeWeight(enterWarehouseId) {
  return request({
    url: '/enterwarehouse/enter/exchange/' + enterWarehouseId,
    method: 'get'
  })
}
